Copyright: Copyright (c) 1995 Okino Computer Graphics, Inc.


IGES Geometry Import Converter
IGES 5.3 Geometry Import Converter

This complex geometry import converter reads in IGES 5.3 ASCII files including the most used NURB entities, their related trim curve information, geometry hierarchy connectivity and polygonal data. The IGES 5.3 specification was published in December 1996.

It has been said that their are over 200 different variations of IGES files that are currently being written by different CAD and 3D software packages. These flavors of IGES, as they are typically referred by, come about because of the way each software manufacturer interprets the 620 page IGES specification. As such, a user of this converter must be careful to choose the correct settings when writing out an IGES file from another program before importing the IGES file into this converter; this steps will be outlined below.

How to successfully read an IGES File into this IGES Converter

As mentioned, the IGES file specification is carefully detailed in a manual of over 620 pages, many of which detail countless numbers of different geometric entities and attributes. In general only about a quarter of the specification is used for translation of 3D polygonal and NURB geometry while the remainder of the specification is not applicable (B-Rep geometry, 2d entities such as lines, hatch symbols, text entities, etc).

To successfully input an IGES file into this converter the following options should be specified in the program which is writing out the IGES file:

•	Output trimmed NURB patches as entities 144 (trimmed parametric surface entity) and 142 (curve on a parametric surface). Do not output as entities 143 (bounded surface entity) and 141 (boundary entity).

•	Please make sure that you specify uv-space or parameter space trimming curves to be output to the 144/142 trimmed surface entity as well as model space trimming curves. If you do not specify parameter space curves then this converter will not be able to cut holes (trim) the NURB surfaces.

•	Do not enable the output of any B-Rep (boundary representation) entities # 180-186.

Supported IGES Entities

The following are the supported 3D entities:

106 - 2D and 3D polygonal data (forms 1, 2, 3)

108 - Bounded plane (form 1)

114 - Parametric spline surface

118 - Ruled surface

120 - Surface of revolution

122 - Tabulated surface

128 - Rational B-Spline surface

All of the above entities will be converted into legal and clean trimmed NURB patches by the import converter.

For the 144 trimmed surface entity, the following 3d surface types are supported as surfaces which can be trimmed by a NURB curve:

108 - Bounded plane (form 0, unbounded plane)

114 - Parametric spline surface

118 - Ruled surface

120 - Surface of revolution

122 - Tabulated surface

128 - Rational B-Spline surface

The following are the supported 2D curve types:

100 - Circular arc

102 - Composite curve

104 - Conic arc

106/12 - Piecewise linear 3d curve (3d line segments)

110 - Line

112 - Parametric B-Spline curve

126 - Rational B-Spline curve

All of the above entities will be converted into legal and clean NURB trim curves by the import converter.

And the following are the remaining supported IGES entities:

124 - Transformation matrix. All inherited hierarchy methods supported as well.

308 - Subfigure definition

314 - Color definition

402 - Group associativity

408 - Subfigure instance

If any of the following 2d curve types are closed and not referenced by another entity then they will be turned into trimmed planar regions if the corresponding option is enabled on the dialog box:

100 - Circular arc

102 - Composite curve

104 - Conic arc

112 - Parametric B-Spline curve

126 - Rational B-Spline curve

Unsupported IGES Entities

There are many IGES entities not supported (and not required) by this converter. The main IGES entities which are not supported are:

108 - Forms 0 and -1, unbounded plane (unless trimmed by curve)

130 - Offset curve

140 - Offset surface

141/143 - Bounded surface (use 142/144 trimmed surface instead)

The main IGES entities which use CSG and B-Rep geometry, but which are not supported by this IGES reader are:

150-169, Constructive Solid Geometry entities

180-186, Manifold solid B-Rep entities

Features of this IGES Reader

1.	All of the major 3d geometry entities, such as tabulated surface, surface of revolution, parametric spline surface and all NURB entities are imported and converted to clean and legal trimmed NURB patches.

2.	The reader fully recreates the geometrical hierarchy of an IGES file via entities 308 (subfigure definitive) and 408 (subfigure instance) in an efficient manner using the instance/object capabilities of the NuGraf/PolyTrans internal database manager. This allows the IGES reader to define an object once (such as a bolt) then have it instanced many times; thus, there only has to be one copy of the geometry in memory even though there are many virtual copies of it in the scene.

3.	The IGES specification does not provide an efficient method to store meshed polygonal data. Rather, each single polygon is typically written to an IGES file within its own entity (#106, copious data). When reading in an IGES file, this converter will flag all of these polygons which belong to a single subfigure definition and accumulate them into an efficient Indexed Polygon mesh primitive rather than create a new object for each polygon read in.

4.	All polygons which do not belong to a subfigure definition will be accumulated and stored in a single indexed polygon mesh with an instance name of lone polygons.

5.	If a circular arc is not subordinate to another entity (ie: it is not used as a trim curve on a NURB surface) then it is turned into a planar NURB patch surface with a circular boundary. The same holds true for composite curves and conic arcs which are closed.

CONVERTER OPTIONS:

The following information explains the various options on the dialog box:

Create and Assign Colored Materials

If an entity has been assigned an explicit color in the IGES file then enabling this option will cause a NuGraf/PolyTrans compatible surface definition (a material) to be created and assigned to the imported geometry which uses the assigned IGES color. If this option is not enabled then no surface definitions will be created.

Create Tessellated NURB Data While Inputting

Before a NURB patch can be displayed within the NuGraf or PolyTrans software it must first be tessellated into triangles. If you enable this checkbox then the tessellation process will be performed as the IGES file is being parsed and read into memory. If you disable the checkbox then the tessellation process will not happen until the file has been completely imported into the program.

Flip Model so that Y Axis is Up

If this checkbox is enabled then the model will be reoriented so that the Up axis of the model will be aligned with the positive Y axis (which is used by the converter) instead of the positive Z axis as used by some IGES files.

Convert Closed Circular Arcs Into Planar Faces

If this checkbox is enabled then any circular arc curves (which are not subordinate to another entity, such as a trimmed surface) will be converted into a solid planar NURB patch object with the outline of the original circular arc. This will allow 2D circular arcs to become 3D in nature so that they can be made visible in a rendered image. If this checkbox is not enabled then all lone circular arcs will not be processed unless they are used as trim curves of 3D entities. Please note that a circular arc will not be turned into a solid patch object if the angle of the arc is less than 355 degrees.

Convert Closed Curves into Planar Faces

If this checkbox is enabled then any closed 2D curves (which are not subordinate to another entity, such as a trimmed surface) will be converted into a solid planar NURB patch object with the outline of the original closed curve. This will allow 2D closed curves to become 3D in nature so that they can be made visible in a rendered image. If this checkbox is not enabled then all lone closed curves will not be processed unless they are used as trim curves of 3D entities. The following IGES curve entities are currently supported by this conversion routine:

102 - Composite curve

104 - Conic arc

112 - Parametric B-Spline curve

126 - Rational B-Spline curve

List Which Entities Are Not Supported

If this checkbox is enabled then entities which are not recognized by the input filter will be printed out.

Report Statistics about the Parsed File

If this checkbox is enabled then statistics about the parsed IGES file will be displayed in the message window after the file has been completely parsed and processed.

Create Smoothing Information for Polygon Data

This converter imports and accumulates Entity # 106 (copious data) as an optimized mesh of polygons. If the accumulated polygon mesh forms a single uniform surface then this option can be enabled to automatically create vertex normals for the new mesh. These normals will make the polygonal surface appear smooth when it is rendered. There are two values that affect the create of smoothed vertex normals:

1.	Vertex Welding Threshold. Before the polygons can be smoothed out all redundant vertices must be removed from the polygon mesh so that all vertices are welded together. If two or more vertices are closer together than the value shown in this type-in box then these vertices will be welded together into a single vertex. Larger values will make more vertices weld together into a single vertex.

2.	Smoothing Cutoff Angle. The smoothing criterion is based on the angle between abutting polygons; common smoothed vertex normals will be computed if the angle between their geometric surfaces normals is less than the angle specified in this type-in value (which defaults to 45 degrees) - in other words, higher values for the smoothing angle will make the surface appear to be more smooth and less angular.

Output Verbose Information to file igesinfo.txt

If this checkbox is enabled then the parser will output detailed information about each parsed entity to the ASCII file igesinfo.txt located in the current working directory.

Output Raw Debug Information to file debugigs.txt

If this checkbox is enabled then the parser will output raw debugging information to the ASCII file debugigs.txt located in the current working directory. This information is rarely used.

NURB Patches Tessellation Method

The parameters in this section of the dialog box specify how a NURB patch is to be subdivided into polygons. Please note that these parameters are actually a mirror copy of those found in the main NuGraf/PolyTrans program in which they are found on the Geometric Subdivisions dialog box; they are duplicated on the IGES reader dialog box for convenience.

There are two NURB subdivision methods supported by the NuGraf & PolyTrans software:

Uniform Subdivision, No Trim Curves

This subdivision method simply subdivides the NURB patch into a uniform mesh of U by V number of rectangular polygons. It produces the fastest tessellation of a NURB patch but it does not allow for NURB patches to be trimmed by trimming curves.

Adaptive Subdivision (with trim curves)

This method adaptively subdivides the NURB patch based on its curvature. Areas with high curvature will be subdivided more finely. This method also allows the NURB patches to be trimmed by trimming curves (if there are any associated with the NURB patches) at the expense of making the tessellation process slower.

The number of polygons used to approximate the true NURB surface (or, its smoothness) is controlled by the Surface Tolerance slider. Lower values will make the surface smoother but at the expense of a longer tessellation time and more resultant polygons. This slider represents the maximum allowable distance (tolerance) between the true NURB patch and the tessellated polygonal surface; it is measured as a percentage of an objects maximum bounding box size. For example, if a NURB patch is being tessellated which is 10x10x10 units in size, and this slider is set to 0.2% then the resultant polygonalized surface will not deviate from the ideal NURB surface by more than 0.02 units (2% of 10).

Also, the Curve Tolerance slider is used to control the smoothness of the NURB trimming curves. Lower values will make trimmed curve regions smoother, but again at the expense of a longer tessellation time and more resultant polygons. This slider represents the maximum allowable distance (tolerance) between the true NURB curve and the tessellated polygonal curve; it is measured as a percentage of an objects maximum bounding box size (the object on which the curve lies). For example, if a NURB patch is being tessellated which is 10x10x10 units in size, and this slider is set to 0.2% then the resultant polygonalized NURB curve will not deviate from the ideal NURB curve by more than 0.02 units (2% of 10).

IGES Processing Parameters

These parameters affect the processing of the IGES data as it is being transformed into internal NURB data format.

Combine Surface Knots Based on Adjacency

A knot is a single floating point value which defines where a patchs world-space control point is located within the patchs (u,v) parameter space. Sometimes two or more knots can be very close together which might cause numerical instability problems. If this option is enabled and the type-in parameter value is set greater than 0.0 then any knots which are closer together than the specified distance will be combined into a single knot value.

Combine Curve Knots Based on Adjacency

This checkbox and its associated type-in numeric value performs the same function as described above except that the knots are used in NURB curves instead of NURB patches.

Minimum Distance Between Control Points of Entity # 102

IGES entity # 102 allows a complex curve to be created from a composite of a series of simpler curves. During the input process this converter stitches all of these simpler curves into a single NURB curve. If the stitching process finds one or more control points that are within the distance specified by this option then all of the control points will be collapsed into a single control point.

Minimum Radius of a Circle

This type-in numeric value specifies the minimum legal radius for an IGES circle. If a circle has a smaller radius then an error will be reported.


NURB Patch Display Options

This dialog allows the NURB patches imported from the IGES file to be displayed either as  a triangulated mesh (Yes) or as simple bounding boxes (No).

Overview

Most IGES data is stored as NURB patches. These are mathematical expressions that describe smooth, curved 3D surfaces. NURB patches cannot, however, be rendered directly without first being converted into polygons. The process of converting NURB patches into a mesh of polygons is called tesselation. For a small number of patches this tesselation process is fast, but for complex IGES files with thousands of patches it can take several minutes to tesselate an entire model. It is for this reason that this dialog box has been provided.

If you press Yes then the program will immediately begin to tesselate the NURB patches into polygons. This may take anywhere from a few seconds to several minutes. Once tesselated the resulting polygon mesh can be rendered or it can be exported to other 3D file formats.

If you press No then the NURB patches will be displayed as bounding boxes rather than the true NURB surface. This option prevents the NURB patches from being tesselated right away. Rather, the slow tesselation process will  only be performed later when the patches are to be rendered or if they are to be exported to another file format.

Please note, however, that the tesselation process only has to be performed once. Thereafter, the polygon mesh will be saved to disk along with the original NURB patch data (but only for Okino`s .bdf file format).

Which Option Should I Select?

Click Yes if:

•	You want to see what the imported NURB patches look like in their approximated polygon mesh format.

•	If you want to enable Shaded Mode within Okinos NuGraf or PolyTrans software (the OpenGL shading mode requires polygons).

•	The number of imported NURB patches is not huge.

Click No if:

•	You only desire to convert the imported NURB patches to another NURB-based file format, such as SoftImage. In this case there is no need to create the tesselated polygon mesh since the NURB data is being directly converted to another file format.

•	If the number of imported NURB patches is very large and/or complex.

•	You do not wish to wait for the imported NURB patches to be tesselated. In this case the NURB patches will only be tesselated prior to rendering or to re-export.

NOTES:

1.	If you do not want this dialog to be displayed every time an IGES file is imported then un-checkmark the Show this dialog box option. To re-enable this dialog box, press the Reset button on the main IGES import dialog box

2.	Once the NURB data has been imported you can enable/disable the bounding box mode by selecting the Display NURB patches as boxes menu item in the Views menu of Okinos PolyTrans and NuGraf software. The default mode is specified by the General Startup Preferences dialog box also contained within these programs.